package hello;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.yh.model.Emp;
import com.yh.utils.MyBatisUtil;

public class TS {

	@Test
	public void test() {
		SqlSession session = null;
		int i=0;
		try {
			session=MyBatisUtil.getSession();
			i=session.selectOne("com.yh.dao.IEmpDao.countAll");
			System.out.println(i);
		} catch (Exception e) {
			// TODO: handle exception
		}finally{
			session.close();
		}
	}
	@Test
	public void shwo(){
		SqlSession session = null;
		try {
			session=MyBatisUtil.getSession();
			//Map map=new HashMap();
			//map.put("empno", 7938);
			Emp emp=session.selectOne("com.yh.dao.IEmpDao.selectOne",7938);
			emp.getClass();
			Class.forName("Emp");
			if(emp!=null){
				System.out.println(1);
				System.out.println(emp.getEmpName()+":"+emp.getJob());
			}else{
				System.out.println(1);
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			session.close();
		}
		
	}
	
	public void sh(){
		
		
	}
}

